import Vue from 'vue'
import App from './App'

// vuex
import store from './store'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'

import mixin from './common/mixin'

Vue.prototype.$store = store

Vue.config.productionTip = false
// import VConsole from "vconsole";
// new VConsole();

import config from './common/config.js'
import {
	validator
} from './common/validator.js'
Vue.prototype.$config = config;
Vue.prototype.$validator = validator;
Vue.prototype.$msg = (title, complete, icon = 'none', duration = 1500, mask = false) => {
	//统一提示方便全局修改
	if (Boolean(title) === false) {
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon,
		complete: complete ? function() {
			setTimeout(function() {
				complete()
			}, duration);
		} : null
	});
};

App.mpType = 'app'
Vue.use(uView)

// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
// #endif

Vue.mixin(mixin)

const app = new Vue({
	store,
	...App
})

// 引入请求封装
require('./util/request/index')(app)

app.$mount()